/// @tags:
#include <cstdio>
#include <functional>
#include <iostream>
#include <numeric>

using std::cin, std::cout, std::endl;

namespace BlueQuantum {

using ll = long long;

constexpr int maxn = 2e5;

int a[maxn + 1];

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = n - 1; i >= 1; --i) {
    a[i] += a[i + 1];
  }
  ll sum = 0;
  for (int i = 2; i <= n; ++i) {
    sum += a[i];
  }
  if (a[1] == 0) {
    int p = 0, q = 0;
    for (int i = 2; i <= n; ++i) {
      if (a[i] == -1) p = i;
      if (a[i] == 1) q = i;
    }
    if (p == 0 || q == 0) {
      cout << "No\n";
    } else {
      cout << "Yes\n1 ";
      ll tmp = 1;
      for (int i = 2; i <= n; ++i) {
        if (i != (sum >= 0 ? p : q))
          cout << (tmp += 1) << ' ';
        else {
          cout << (tmp += 1 + std::abs(sum)) << ' ';
        }
      }
    }
  } else {
    cout << "Yes\n";
    ll tmp = 0;
    cout << (tmp = a[1] > 0 ? -sum : sum) << ' ';
    for (int i = 2; i <= n; ++i) {
      cout << (tmp += std::abs(a[1])) << ' ';
    }
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("C - ± Increasing Sequence.in", "r", stdin);
  freopen("C - ± Increasing Sequence.out", "w", stdout);
#endif
#endif

  std::ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
